<?php
/* @var $this SiteController */

$this->pageTitle=Yii::app()->name;

?>

<div class="large-12 columns">
	<div class="row">
		<div class="large-12 medium-12 small-12 columns">
			<ul class="example-orbit" data-orbit data-options="bullets:false;">
				<li data-orbit-slide="headline-1">
					<img src="<?php echo Yii::app()->request->baseUrl; ?>/images/1.jpg" height="290px" alt="slide 1" />
					<div class="orbit-caption">
						Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilite de un nov lingua franca: On refusa
					</div>
				</li>
				<li>
					<img src="<?php echo Yii::app()->request->baseUrl; ?>/images/2.jpg" height="290px" alt="slide 2" />
					<div class="orbit-caption">
						Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilite de un nov lingua franca: On refusa
					</div>
				</li>
				<li>
					<img src="<?php echo Yii::app()->request->baseUrl; ?>/images/3.jpg" height="290px" alt="slide 3" />
					<div class="orbit-caption">
						Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilite de un nov lingua franca: On refusa
					</div>
				</li>
			</ul>
		</div>
	</div>

<div class="table">

	<div class="row">
		<?php 
		if(count($news)>0 || count($sales)>0){
			if(count($news)>0){
				$newsColSize = count($sales)>0 ? 9 : 12;
				echo '
<div class="large-'.$newsColSize.' columns">
					<div class="row">
						<h3 class="larg-12 columns"><a href="'.$this->createUrl('news/index').'">News</a></h3>';
				
					if(count($news)>0){
						$colSize = 12/count($news);
						foreach ($news as &$newsItem) {
							echo '<div class="large-'.$colSize.' small-6 columns">';
							echo $this->renderPartial('../_card', array('model'=>$newsItem));
							echo '</div>';
						}
					}
				echo '</div></div>';
			}
			if(count($sales)>0){
				$salesColSize = count($news)>0 ? 3 : 12;
				echo '<div class="large-'.$salesColSize.' columns">
					<h3 class=""><a href="">Sales</a></h3>';
					if(count($news)>0){
						echo '<ul class="no-bullet sales">';
						foreach ($sales as &$sale) {
							echo '<li><a href="'.$this->createUrl('catalogItem/view', array('id'=>$sale->id)).'"><div class="row">
									<img class="large-4 columns" src="'.$sale->pictures[0]->url.'" />
									<h5 class="large-8 columns">'.$sale->title.'</h5>
									</div></a></li>';
						}
						echo '</ul>';
					}else{
						$colSize = 12/count($sales);
						echo '<div class="row">';
						foreach ($sales as &$sale) {
							echo '<div class="large-'.$colSize.' small-6 columns">';
							echo $this->renderPartial('../_card', array('model'=>$sale));
							echo '</div>';
						}
						echo '</div>';
					}
				echo '</div>';
			}
		}
		?>
	</div>


	<?php 
		foreach($catalogs as &$catalog){
			echo '<div class="row"><h3 class="larg-12 columns"><a href="'.$this->createUrl('catalog/view', array('id'=>$catalog->id)).'">'.$catalog->title.'</a></h3>';
			foreach($catalog->catalogItems as &$catalogItem){
				echo '<div class="large-4 small-6 columns">';
				echo $this->renderPartial('../_card', array('model'=>$catalogItem));
				echo '</div>';
			}
			echo '</div>';
		}
	?>

</div>
	
</div>
